<template>
  <RHForm :RHForm="form"></RHForm>
</template>
<script>
import RHForm from "@/common/form/index";

export default {
  name: "Test",
  data() {
    return {
      form: [
        {
          el: "input",
          label: "姓名",
          prop: { type: "", required: true, max: 5 },
          placeholder: "",
          model: "name"
        },
        {
          el: "select",
          label: "性别",
          prop: { type: "", required: true },
          error: "",
          placeholder: "请选择",
          model: "sex",
          candidate: {
            label: "roleName",
            value: "roleId",
            values: [{ name: "男", id: "0" }, { name: "女", id: "1" }],
            url:
              this.$store.state.url.user + "api/users/renHaiRole/getRoleAllList"
          }
        },
        { el: "switch", label: "状态", model: "state" },
        {
          el: "checkbox",
          label: "爱好",
          model: "hobby",
          candidate: {
            label: "roleName",
            value: "roleId",
            values: [
              { name: "唱歌", id: "0" },
              { name: "跳舞", id: "1" },
              { name: "看书", id: "2" }
            ],
            url:
              this.$store.state.url.user + "api/users/renHaiRole/getRoleAllList"
          }
        },
        {
          el: "radio",
          label: "是否激活",
          model: "activate",
          candidate: {
            label: "roleName",
            value: "roleId",
            values: [{ name: "否", id: "0" }, { name: "是", id: "1" }],
            url:
              this.$store.state.url.user + "api/users/renHaiRole/getRoleAllList"
          }
        }
      ]
    };
  },
  components: {
    RHForm
  }
};
</script>

<style scoped></style>
